package com.yang.modules.common.deploy.amqp.strategy;

import com.yang.common.amqp.BaseStrategy;
import com.yang.modules.common.deploy.RefreshHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


import java.util.Map;

/**
 * 服务上线/下线刷新策略
 * @author Billyang
 * @date 2024/9/18 15:03
 */
@Slf4j
@Component(StrategyConstants.REFRESH_STRATEGY)
public class RefreshStrategy implements BaseStrategy<Map<String,Object>> {

    @Autowired
    private RefreshHandler refreshHandler;
    @Override
    public void doStrategy(Map<String,Object> params) {
        log.info("refreshStrategy params:{}", params);
        refreshHandler.refresh();
        log.info("#### refreshStrategy success");
    }
}
